<template>
	<view class="prod-aside">
		<view class="sec label">
			常规型号
		</view>
		<view class="sec normal" v-for="(item, index) in normalTypes" :key="item.key" @click="normalChosed(item, index)" :class="{'checked':normalActive === index}">
			<view class="inner-txt nt">
				{{item.value}}
			</view>
		</view>
		<view class="sec label">
			窄 V 带型
		</view>
		<view class="sec v" v-for="(item, index) in vTypes" :key="item.key" @click="vTypesChosed(item, index)" :class="{'checked':vActive === index}">
			<view class="inner-txt vt">
				{{item.value}}
			</view>
		</view>
		<view class="sec" @click="setChose">
			定制型号
		</view>
	</view>
</template>

<script>
	import { normalTypes, vTypes } from '../../utils/data.js'
	export default {
		props: ['type'],
		data() {
			return {
				normalTypes,
				normalActive: this.type === 'n' ? 0 : -1,
				vTypes,
				vActive: this.type === 'v' ? 0 : -1
			};
		},
		methods: {
			normalChosed(item, i) {
				this.normalActive = i
				this.vActive = -1
				this.$emit('normalChosed', item)
			},
			vTypesChosed(item, i) {
				this.vActive = i
				this.normalActive = -1
				this.$emit('vTypesChosed', item)
			},
			setChose() {
				this.normalActive = 0
				this.vActive = -1
				this.$emit('setChose')
			}
		}
	}
</script>

<style>
.prod-aside {
	width: 170upx;
	position: absolute;
	top: 0;
	left: 0;
	bottom: 0;
	font-size:24upx;
	font-weight:500;
	background: #FFFFFF;
}
.sec {
	height: 64upx;
	text-align: center;
	line-height: 64upx;
	color: #333333;
	box-sizing: border-box;
	border-left: 1upx solid transparent;
	border-bottom: 4upx solid #f5f5f5;
	
}
.inner-txt {
	height: 100%;
	width: 98upx;
	margin: 0 auto;
	text-align: justify;
}

.inner-txt:after {
	content:'.';
	width: 100%;
	display: inline-block;
	overflow: hidden;
	height: 0;
} 

.vt {
	letter-spacing: 7upx;
}

/* .inner-txt:after {
	content:'.';
	width: 100%;
	display: inline-block;
	overflow: hidden;
	height: 0;
} */


.checked {
	background:rgba(17,24,33,1);
	color: #EA0A2A;
	border-left: 1upx solid #EA0A2A;
}
/* .normal:first-letter {
	margin-right: 77upx;
}
.v {
	letter-spacing: 6upx;
} */
.label {
	background:rgba(245,245,245,1);
	color:rgba(179,179,179,1);
}
</style>
